using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableRefundItem
	{
		public const string Table = "RefundItem";
		public const string RefundItemID = "RefundItemID";
		public const string OrdersID = "OrdersID";
		public const string OrderTradeNo = "OrderTradeNo";
		public const string TotalAmount = "TotalAmount";
		public const string RefundrDate = "RefundrDate";
		public const string BatchNo = "BatchNo";
		public const string PayInfo = "PayInfo";
		public const string PayStatus = "PayStatus";
		public const string RefundCompleteDate = "RefundCompleteDate";
		public const string OrderNo = "OrderNo";
	}
	
	[Serializable]
	public class BaseRefundItem
		: IDbSessionEntity, IJsonClass
	{
		int m_RefundItemID;
		/// <summary>
        /// 退款项表ID
        /// </summary>
        public int RefundItemID
        {
            get { return m_RefundItemID; }
            set { m_RefundItemID = value; }
        }
		
		int? m_OrdersID;
		/// <summary>
        /// 订单表ID
        /// </summary>
        public int? OrdersID
        {
            get { return m_OrdersID; }
            set { m_OrdersID = value; }
        }
		
		string m_OrderTradeNo;
		/// <summary>
        /// 订单支付宝支付交易流水号
        /// </summary>
        public string OrderTradeNo
        {
            get { return m_OrderTradeNo; }
            set { m_OrderTradeNo = value; }
        }
		
		double m_TotalAmount;
		/// <summary>
        /// 金额
        /// </summary>
        public double TotalAmount
        {
            get { return m_TotalAmount; }
            set { m_TotalAmount = value; }
        }
		
		DateTime? m_RefundrDate;
		/// <summary>
        /// 退款开始时间
        /// </summary>
        public DateTime? RefundrDate
        {
            get { return m_RefundrDate; }
            set { m_RefundrDate = value; }
        }
		
		string m_BatchNo;
		/// <summary>
        /// 退款批次号
        /// </summary>
        public string BatchNo
        {
            get { return m_BatchNo; }
            set { m_BatchNo = value; }
        }
		
		string m_PayInfo;
		/// <summary>
        /// 交易返回信息
        /// </summary>
        public string PayInfo
        {
            get { return m_PayInfo; }
            set { m_PayInfo = value; }
        }
		
		int m_PayStatus;
		/// <summary>
        /// 支付状态
        /// </summary>
        public int PayStatus
        {
            get { return m_PayStatus; }
            set { m_PayStatus = value; }
        }
		
		DateTime? m_RefundCompleteDate;
		/// <summary>
        /// 退款成功时间
        /// </summary>
        public DateTime? RefundCompleteDate
        {
            get { return m_RefundCompleteDate; }
            set { m_RefundCompleteDate = value; }
        }
		
		string m_OrderNo;
		/// <summary>
        /// 订单号
        /// </summary>
        public string OrderNo
        {
            get { return m_OrderNo; }
            set { m_OrderNo = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_RefundItemID = reader[TableRefundItem.RefundItemID];
            m_OrdersID = reader[TableRefundItem.OrdersID];
            m_OrderTradeNo = reader[TableRefundItem.OrderTradeNo];
            m_TotalAmount = reader[TableRefundItem.TotalAmount];
            m_RefundrDate = reader[TableRefundItem.RefundrDate];
            m_BatchNo = reader[TableRefundItem.BatchNo];
            m_PayInfo = reader[TableRefundItem.PayInfo];
            m_PayStatus = reader[TableRefundItem.PayStatus];
            m_RefundCompleteDate = reader[TableRefundItem.RefundCompleteDate];
            m_OrderNo = reader[TableRefundItem.OrderNo];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableRefundItem.RefundItemID, PrimaryKeyType.Identity, RefundItemID);
			writer[TableRefundItem.OrdersID] = OrdersID;
			writer[TableRefundItem.OrderTradeNo] = OrderTradeNo;
			writer[TableRefundItem.TotalAmount] = TotalAmount;
			writer[TableRefundItem.RefundrDate] = RefundrDate;
			writer[TableRefundItem.BatchNo] = BatchNo;
			writer[TableRefundItem.PayInfo] = PayInfo;
			writer[TableRefundItem.PayStatus] = PayStatus;
			writer[TableRefundItem.RefundCompleteDate] = RefundCompleteDate;
			writer[TableRefundItem.OrderNo] = OrderNo;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_RefundItemID = idd;
        }
		
		public string TableName
        {
            get { return TableRefundItem.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_RefundItemID = hashToRead["RefundItemID"];
			 
             m_OrdersID = hashToRead["OrdersID"];
			 
             m_OrderTradeNo = hashToRead["OrderTradeNo"];
			 
             m_TotalAmount = hashToRead["TotalAmount"];
			 
             m_RefundrDate = hashToRead["RefundrDate"];
			 
             m_BatchNo = hashToRead["BatchNo"];
			 
             m_PayInfo = hashToRead["PayInfo"];
			 
             m_PayStatus = hashToRead["PayStatus"];
			 
             m_RefundCompleteDate = hashToRead["RefundCompleteDate"];
			 
             m_OrderNo = hashToRead["OrderNo"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["RefundItemID"] = RefundItemID;
			 
            hashToFill["OrdersID"] = OrdersID;
			 
            hashToFill["OrderTradeNo"] = OrderTradeNo;
			 
            hashToFill["TotalAmount"] = TotalAmount;
			 
            hashToFill["RefundrDate"] = RefundrDate;
			 
            hashToFill["BatchNo"] = BatchNo;
			 
            hashToFill["PayInfo"] = PayInfo;
			 
            hashToFill["PayStatus"] = PayStatus;
			 
            hashToFill["RefundCompleteDate"] = RefundCompleteDate;
			 
            hashToFill["OrderNo"] = OrderNo;
			 
        }

        #endregion
		
	}
}
